(global.webpackJsonp = global.webpackJsonp || []).push([ [ "luck/draw/index" ], {
    "6d61": function(t, e, i) {
        i.r(e);
        var n = i("f52a"), r = i.n(n);
        for (var o in n) "default" !== o && function(t) {
            i.d(e, t, function() {
                return n[t];
            });
        }(o);
        e.default = r.a;
    },
    "6dfd": function(t, e, i) {
        i.d(e, "b", function() {
            return n;
        }), i.d(e, "c", function() {
            return r;
        }), i.d(e, "a", function() {});
        var n = function() {
            this.$createElement;
            this._self._c;
        }, r = [];
    },
    "7ee7": function(t, e, i) {},
    ad1a: function(t, e, i) {
        var n = i("7ee7");
        i.n(n).a;
    },
    dc09: function(t, e, i) {
        (function(t) {
            i("1067"), n(i("66fd"));
            var e = n(i("deb0"));
            function n(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }
            wx.__webpack_require_UNI_MP_PLUGIN__ = i, t(e.default);
        }).call(this, i("543d").createPage);
    },
    deb0: function(t, e, i) {
        i.r(e);
        var n = i("6dfd"), r = i("6d61");
        for (var o in r) "default" !== o && function(t) {
            i.d(e, t, function() {
                return r[t];
            });
        }(o);
        i("ad1a");
        var a = i("f0c5"), d = Object(a.a)(r.default, n.b, n.c, !1, null, "0db9e0ce", null, !1, n.a, void 0);
        e.default = d.exports;
    },
    f52a: function(t, e, i) {
        (function(t) {
            Object.defineProperty(e, "__esModule", {
                value: !0
            }), e.default = void 0;
            var n = i("a71e"), r = i("d7af"), o = i("8434"), a = i("7960"), d = i("26cb"), c = function(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }(i("801c")), u = i("b806"), s = (i("db8f"), i("93b4"));
            function f(t) {
                return function(t) {
                    if (Array.isArray(t)) return l(t);
                }(t) || function(t) {
                    if ("undefined" != typeof Symbol && Symbol.iterator in Object(t)) return Array.from(t);
                }(t) || function(t, e) {
                    if (t) {
                        if ("string" == typeof t) return l(t, e);
                        var i = Object.prototype.toString.call(t).slice(8, -1);
                        return "Object" === i && t.constructor && (i = t.constructor.name), "Map" === i || "Set" === i ? Array.from(t) : "Arguments" === i || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i) ? l(t, e) : void 0;
                    }
                }(t) || function() {
                    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
                }();
            }
            function l(t, e) {
                (null == e || e > t.length) && (e = t.length);
                for (var i = 0, n = new Array(e); i < e; i++) n[i] = t[i];
                return n;
            }
            function p(t, e) {
                var i = Object.keys(t);
                if (Object.getOwnPropertySymbols) {
                    var n = Object.getOwnPropertySymbols(t);
                    e && (n = n.filter(function(e) {
                        return Object.getOwnPropertyDescriptor(t, e).enumerable;
                    })), i.push.apply(i, n);
                }
                return i;
            }
            function g(t, e, i) {
                return e in t ? Object.defineProperty(t, e, {
                    value: i,
                    enumerable: !0,
                    configurable: !0,
                    writable: !0
                }) : t[e] = i, t;
            }
            var h = i("fd22"), m = i("69d6"), y = i("a81c"), b = i("72ca"), _ = {
                components: {
                    LotteryDraw: function() {
                        Promise.all([ i.e("common/vendor"), i.e("luck/draw/components/SJ-LotteryDraw/SJ-LotteryDraw") ]).then(function() {
                            return resolve(i("eca1"));
                        }.bind(null, i)).catch(i.oe);
                    },
                    myTurntableDraw: function() {
                        i.e("luck/draw/components/my-turntable-draw").then(function() {
                            return resolve(i("0bbe"));
                        }.bind(null, i)).catch(i.oe);
                    }
                },
                computed: function(t) {
                    for (var e = 1; e < arguments.length; e++) {
                        var i = null != arguments[e] ? arguments[e] : {};
                        e % 2 ? p(Object(i), !0).forEach(function(e) {
                            g(t, e, i[e]);
                        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(i)) : p(Object(i)).forEach(function(e) {
                            Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(i, e));
                        });
                    }
                    return t;
                }({}, (0, d.mapGetters)([ "configs", "user", "mainColor", "iphoneXStyle" ])),
                data: function() {
                    return {
                        isShow: !0,
                        type: 1,
                        typeZj: 0,
                        isBar: "",
                        block: [ {
                            padding: "0px",
                            imgs: [ {
                                src: m,
                                width: "100%",
                                height: "100%"
                            } ]
                        }, {
                            padding: "42px 40px 40px 40px"
                        } ],
                        blocks: [ {
                            padding: "50rpx",
                            imgs: [ {
                                src: y,
                                width: "100%",
                                height: "100%"
                            } ]
                        } ],
                        prize: [],
                        prize_before: [ {
                            x: 0,
                            y: 0,
                            range: "",
                            imgs: [],
                            fonts: []
                        }, {
                            x: 1,
                            y: 0,
                            range: 0,
                            imgs: [],
                            fonts: []
                        }, {
                            x: 2,
                            y: 0,
                            range: 0,
                            imgs: [],
                            fonts: []
                        }, {
                            x: 2,
                            y: 1,
                            range: 0,
                            imgs: [],
                            fonts: []
                        }, {
                            x: 2,
                            y: 2,
                            range: 0,
                            imgs: [],
                            fonts: []
                        }, {
                            x: 1,
                            y: 2,
                            range: 0,
                            imgs: [],
                            fonts: []
                        }, {
                            x: 0,
                            y: 2,
                            range: 0,
                            imgs: [],
                            fonts: []
                        }, {
                            x: 0,
                            y: 1,
                            range: 0,
                            imgs: [],
                            fonts: []
                        } ],
                        prizes: [],
                        defaultConfig: {
                            gutter: 10,
                            speed: 20
                        },
                        button: [ {
                            radius: "45%",
                            imgs: [ {
                                src: b,
                                width: "60%",
                                top: "-65%"
                            } ]
                        } ],
                        buttons: [ {
                            x: 1,
                            y: 1,
                            background: "#fff",
                            imgs: [ {
                                src: h,
                                width: "100%",
                                height: "100%"
                            } ]
                        } ],
                        defaultConfigs: {
                            gutter: 0,
                            speed: 15
                        },
                        defaultStyle: {
                            background: "#ffffff",
                            borderRadius: 15,
                            shadow: "0px 4px 3px #E7B4BD"
                        },
                        activeStyle: {
                            background: "#FEF4AD"
                        },
                        id: "",
                        dataInfo: {},
                        title: "",
                        bgImg: "",
                        lottery_draw_param: {
                            startIndex: 0,
                            totalCount: 4,
                            winingIndex: 4,
                            speed: 50
                        },
                        grid: [],
                        checkGrid: [],
                        lotteryConfig: {
                            lotterySize: 640,
                            actionSize: 200
                        },
                        prizeing: !1,
                        prizeIndex: -1,
                        prizeList: [],
                        prizeLists: [],
                        prizeListBefore: [],
                        lotteryBg: i("a81c"),
                        actionBg: i("72ca"),
                        boxData: {
                            width: 600,
                            height: 600
                        },
                        targetIndex: 0
                    };
                },
                created: function() {},
                onLoad: function(t) {
                    this.id = t.id, (0, n.isEmpty)(t.pid) || c.default.commit("config/SET_PID", t.pid), 
                    (0, n.isEmpty)(decodeURIComponent(t.scene).split("pid=")[1]) || c.default.commit("config/SET_PID", decodeURIComponent(t.scene).split("pid=")[1]);
                },
                onShow: function() {
                    var t = this;
                    (0, u.init)(t).then(function(e) {
                        t.isBar = e, t.getDetial();
                    });
                },
                onShareAppMessage: function(t) {
                    var e = (0, n.isEmpty)(this.user.id) ? 0 : this.user.id;
                    return "button" === t.from && this.$refs.BotShow.isBotShow(), {
                        title: this.goodInfo.title,
                        path: "/luck/draw/index?id=" + this.id + "&pid=" + e
                    };
                },
                onShareTimeline: function() {
                    var t = (0, n.isEmpty)(this.user.id) ? 0 : this.user.id;
                    return {
                        title: this.goodInfo.title,
                        query: "id=" + this.id + "&pid=" + t,
                        imageUrl: this.dataInfo.top_bg_img
                    };
                },
                methods: {
                    get_winingIndex: function(t) {
                        var e = this, i = new Date().getTime() / 1e3;
                        if (e.dataInfo.luck_tody_draw_num <= 0 || e.dataInfo.start_time > i || i > e.dataInfo.end_time) return e.$toast("今日已不可抽奖", "none");
                        var n = {
                            id: this.id
                        };
                        (0, a.h5JudgeLogin)(2).then(function(i) {
                            i || (0, s.luckBefore)(n).then(function(i) {
                                e.lottery_draw_param.winingIndex = e.getWeight(e.checkGrid), t(e.lottery_draw_param);
                            });
                        });
                    },
                    luck_draw_finish: function(t) {
                        this.endCallBack(t);
                    },
                    befoterClick: function(t) {
                        var e = this, i = new Date().getTime() / 1e3;
                        if (e.dataInfo.luck_tody_draw_num <= 0 || e.dataInfo.start_time > i || i > e.dataInfo.end_time) return e.$toast("今日已不可抽奖", "none");
                        var n = {
                            id: this.id
                        };
                        (0, a.h5JudgeLogin)(2).then(function(i) {
                            i || "start" == t.type && (0, s.luckBefore)(n).then(function(i) {
                                e.targetIndex = e.getWeight(e.prizeLists), t.callback && t.callback(e.targetIndex);
                            });
                        });
                    },
                    afterClick: function(t) {
                        "end" == t.type && (t.callback && t.callback(), this.endCallBack(this.prizeListBefore[this.targetIndex]));
                    },
                    getDetial: function() {
                        var e = this, i = {
                            id: this.id
                        };
                        e.prizes = [], (0, s.luckInfo)(i).then(function(i) {
                            e.dataInfo = i;
                            var n = new Date().getTime();
                            if ((e.dataInfo.luck_tody_draw_num < 0 || e.dataInfo.start_time <= n && n <= e.dataInfo.end_time) && e.$toast("今日已不可抽奖", "none"), 
                            2 == i.type) {
                                e.prizeList = [];
                                var r = [];
                                e.prizeLists = [], e.prizeListBefore = i.prize, i.prize.map(function(t, e) {
                                    r.push({
                                        img: t.img,
                                        stock: t.stock,
                                        prizeId: t.product_id,
                                        prizeName: t.show_title,
                                        prizeStock: t.stock,
                                        prizeImage: t.img,
                                        prizeWeight: t.probability,
                                        probability: t.probability,
                                        integral: t.integral,
                                        product_id: t.product_id,
                                        show_title: t.show_title,
                                        term_day: t.term_day,
                                        term_type: t.term_type,
                                        title: t.title,
                                        type: t.type,
                                        name: t.show_title,
                                        count: t.stock,
                                        image: t.img
                                    });
                                }), e.prizeList = JSON.parse(JSON.stringify(r)), e.prizeLists = JSON.parse(JSON.stringify(r));
                            } else {
                                e.grid = [], i.prize.map(function(t, i) {
                                    e.grid.push(t);
                                });
                                e.checkGrid = JSON.parse(JSON.stringify(e.grid)), e.grid.push({
                                    img: "",
                                    integral: "0",
                                    probability: "0",
                                    product_id: "",
                                    show_title: "",
                                    stock: "0",
                                    term_day: "0",
                                    term_type: "0",
                                    title: null,
                                    type: "1"
                                });
                            }
                            t.setNavigationBarTitle({
                                title: i.title
                            });
                        });
                    },
                    getWeight: function(t) {
                        var e, i = this, n = "", o = f(e = t.map(function(t) {
                            return t.probability;
                        }));
                        return o.sort(function(t, e) {
                            return e - t;
                        }), (n = n > 0 ? n : o[0]) && e.length ? 1 == i.dataInfo.type ? (0, r.luckGl)(n, i.checkGrid, e) : (0, 
                        r.luckGl)(n, i.prizeLists, e) : (console.warn("###当前已开启前端控制中奖概率，但是奖品数据列表中的 prizeWeight 参数似乎配置不正确###"), 
                        this.$toast("参数配置不正确"));
                    },
                    getReturnDetial: function() {
                        var t = this, e = {
                            id: this.id
                        };
                        (0, s.luckInfo)(e).then(function(e) {
                            t.dataInfo = e;
                        });
                    },
                    goHdgz: function() {
                        (0, o.route)({
                            url: "/pages/html/index",
                            type: 1,
                            data: {
                                id: this.id,
                                type: 5
                            }
                        });
                    },
                    goZjjl: function() {
                        var t = this;
                        (0, a.h5JudgeLogin)(2).then(function(e) {
                            e || (0, o.route)({
                                url: "/luck/draw/record",
                                type: 1,
                                data: {
                                    id: t.id
                                }
                            });
                        });
                    },
                    confirm: function() {},
                    endCallBack: function(t) {
                        var e = this, i = {
                            id: this.id,
                            prize: t,
                            index: 1 == e.dataInfo.type ? this.lottery_draw_param.winingIndex : this.targetIndex
                        };
                        (0, s.luckBegin)(i).then(function(i) {
                            e.bgImg = t.img, e.title = t.show_title, e.typeZj = t.type, e.$refs.model.openModel(), 
                            e.getReturnDetial();
                        });
                    }
                }
            };
            e.default = _;
        }).call(this, i("543d").default);
    }
}, [ [ "dc09", "common/runtime", "common/vendor" ] ] ]);